<template>
  <div class="base-b">
    <div>我是B组件（发布方）</div>
    <button @click="sendMsg('你好啊')">发送消息</button>
    <button @click="sendMsg('下水道烤串')">发送消息</button>
  </div>
</template>

<script>
import EventBus from '@/utils/EventBus';
export default {
  methods:{
    sendMsg(value){
      EventBus.$emit('message', value)
    }
  }
}
</script>

<style scoped>
.base-b {
  width: 200px;
  height: 200px;
  border: 3px solid #000;
  border-radius: 3px;
  margin: 10px;
}
</style>